home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / init.d / acpi-support next >
Text File  |  2008-09-25  |  762b  |  36 lines

  1. #!/bin/bash
  2. # INIT script to check whether we're on batteries, and so start with laptop 
  3. # mode etc enabled.
  4.  
  5. # BUGS: unless we start *really* late, we have no way of throttling 
  6. # xscreensaver, since it won't be there to command.
  7. . /usr/share/acpi-support/power-funcs
  8.  
  9. test -f /lib/lsb/init-functions || exit 1
  10. . /lib/lsb/init-functions
  11.  
  12. test -d /var/lib/acpi-support || exit 0
  13.  
  14. shopt -s nullglob
  15.  
  16. case "$1" in
  17.   start)
  18.     log_begin_msg "Checking battery state..."
  19.     /etc/acpi/power.sh
  20.     # Source everything in /etc/acpi/start.d/
  21.     for SCRIPT in /etc/acpi/start.d/*.sh; do
  22.     . $SCRIPT
  23.     done
  24.     log_end_msg 0
  25.     ;;
  26.   stop)
  27.     log_begin_msg "Disabling power management..."
  28.     /etc/acpi/power.sh stop
  29.     log_end_msg 0
  30.     ;;
  31.   *)
  32.   ;;
  33. esac
  34.         
  35.  
  36.